import request from 'umi-request';
import type { Reducer, Effect } from 'umi';

export type StateType = {
  list?: any[];
};

export type ModelType = {
	namespace: 'user';
	state: StateType;
	reducers: {
		updateState: Reducer<StateType>;
	};
	effects: {
		getData: Effect;
	};
};

const Model: ModelType = {
	namespace: 'user',
	state: {
		list: [],
	},
	reducers: {
		updateState(state, {payload}) {
			return {...state, ...payload};
		}
	},
	effects: {
		* getData({payload}, {call, put}) {
			console.log(222);
		}
	}
};

export default Model;